const { Schema, model } = require('mongoose');
const testsSchema = new Schema({
    title: String, // 试卷标题
    date: String, // 考试时间
    time: String, // 答题时长
    typeId: {
        type: Schema.Types.ObjectId,
        ref: 'typesModel'
    },
    exercisesId: [  // 当前试卷关联的所有题目 _id
        {
            type: Schema.Types.ObjectId,
            ref: 'exercisesModel'
        }
    ]
}, { versionKey: false });
//2.设置数据模型，同时连接数据集合
module.exports.testsModel = model('testsModel', testsSchema, 'tests');